/**
 * Created by xiangjiayu on 2017/6/7.
 * 自定义 多选框
 */
import React from 'react';
import {Icon} from 'antd';

export default class CheckBox extends React.Component {
    //单选
    _CheckRadio = (e) => {
    }
    //多选
    _CheckBox = (e) => {
    }

    render() {
        let data = this.props.data;
        let that = this;
        return (
            <div className="checkbox-ul">
                <ul>
                    {
                        data.map((item, index) => {
                            return (
                                <li onClick={item.type == 'radio' ? that._CheckRadio.bind(this) : that._CheckBox}
                                    key={index}
                                    className={item.state ? 'checkbox-li checked' : 'checkbox-li'}>{item.text}<span
                                    className="icon-span"><Icon type="check"/></span></li>
                            )
                        })
                    }
                </ul>
            </div>
        )
    }
}